<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" href="../layui/css/layui.css" media="all" />
	</head>
	<style>
		::-webkit-scrollbar {display:none}/*隐藏横向滚动条但可以滚动*/
		input[type="text"]{width: 300px;}
		.div{width: 500px;height: 450px;margin-left: 30px;}
	</style>
	<body>
			<div class="div">
				<form class="layui-form" action="">
				  <div class="layui-form-item">
				    <label class="layui-form-label">联系人名称:</label>
				    <div class="layui-input-block">
				      <input type="text" name="contactname" required  lay-verify="required" placeholder="请输入联系人名称" autocomplete="off" class="layui-input">
				    </div>
				  </div>
					<div class="layui-form-item">
						<label class="layui-form-label">与员工关系: </label>
						<div class="layui-input-block">
							<input type="text" name="relationship" required  lay-verify="required" placeholder="请输入内容 " autocomplete="off" class="layui-input">
						</div>
					</div>
				  <div class="layui-form-item">
				    <label class="layui-form-label">联系电话: </label>
				    <div class="layui-input-block">
				      <input type="text" name="phone" required  lay-verify="required" placeholder="请输入联系电话" autocomplete="off" class="layui-input">
				    </div>
				  </div>
				  <div class="layui-form-item layui-form-text"  style="width: 420px;">
				    <label class="layui-form-label"><i class="layui-icon">&#xe702;</i> 说    明   : </label>
				    <div class="layui-input-block">
				      <textarea name="remark" placeholder="请输入内容" class="layui-textarea"></textarea>
				    </div>
				  </div>
				  <div class="layui-form-item">
				    <div class="layui-input-block">
				      <button class="layui-btn layui-btn-radius layui-btn-normal" lay-submit lay-filter="formDemo"><i class="layui-icon">&#xe609;</i>保存</button>
				      <button type="reset" class="layui-btn layui-btn-radius layui-btn-primary "><i class="layui-icon">&#xe669;</i> 重置</button>
				    </div>
				  </div>
				</form>
			</div>
			
	</body>
		<script src="../js/jquery/jquery-3.1.0.min.js"></script>
	<script src="../layui/layui.js"></script>
	<script>
			layui.use(['form','element','upload','laydate'], function(){
						  var $ = layui.jquery
						  ,element = layui.element; //Tab的切换功能，切换事件监听等，需要依赖element模块
						  var form=layui.form;
						  var laydate=layui.laydate;
						  
						  
						  laydate.render({
							  elem: '#hireDay'
							});
							 laydate.render({
							  elem: '#fireDay'
							});

				//监听提交
				//你可以在这里做操作  也可以不使用这个方法
				form.on('submit(formDemo)', function(data){
					$.ajax({
						url: '/option/linkadd',
						type: 'post',
						data:data.field,
						dataType: 'json',
						success:function(data){
							if(data){
								//先得到当前iframe层的索引
								var index = parent.layer.getFrameIndex(window.name);
								//再执行关闭
								parent.layer.close(index);
								layer.msg(JSON.stringify("添加成功"));
								window.parent.location.reload();
							}else {
								layer.msg('添加失败', { icon: 5, time: 2000 });
							}
						},
					})
					return false;
				});
			 });
	</script>
</html>
